/*
 * @Date: 2024-08-30 09:55:10
 * @Author: LiSong
 * @LastEditors: LiSong
 * @LastEditTime: 2024-10-31 11:10:40
 * @Description: ParseUtils
 */
import XEUtils from 'xe-utils';
import { TableDataType } from '@/base/pojo/TableDataType.js'

export default {
  parseValueByType: (value, type) => {
    let result = value
    if (TableDataType.STRING.equals(type)) {
      result = XEUtils.toValueString(result)
    } else if (TableDataType.NUMBER.equals(type)) {
      result = XEUtils.toNumber(result)
    } else {
      result = value
    }
    return result
  }
}